***REPLICATION CODE for Nanes and Haim, "Self Administered Field Surveys on Sensitive Topics"
***Journal of Experimental Political Science - Conditionally accepted April 28, 2020
***Corresponding author: Matthew Nanes

*Open data
cd "~\Dropbox\DHN Philippine Police\3. EGAP (POP - One Sorsogon Reloaded)\3.12 - Articles and Chapters\3.12.5 Self Enumeration and Sensitive Items\Replication Materials"
use "NanesandHaim JEPS Replication.dta"

*Generate and lable interaction terms to be used later
gen selfenum_education=selfenum*education
label variable selfenum_education "Self x Education"
gen rr_education=randomresp*education
label variable rr_education "RR x Education"

**********************ANALYSIS*********************

**Non-Response**

*FIGURE 2 (main text): Response Rates by Experimental Group
*(0+1="Answered, 97="Don't Know", 98="Refuse to Answer")
tab placdir
tab placself
tab placrr

*(0+1="Answered, 97="Don't Know", 98="Refuse to Answer")
tab sensitivedir
tab sensitiveself
tab sensitiverr

*TABLE 1(appendix): Non-Response to Sensitive Question
xtset psgc
eststo clear
eststo: logit sensitivenr i.sensitivecat, cl(psgc)
eststo: xtlogit sensitivenr i.sensitivecat, fe
eststo: xtlogit sensitivenr i.sensitivecat crowd selfenum_crowd education male age income, fe
*esttab using "nonresp_sensitive.tex", se star(* .10 ** .05 *** .01) nodep mtitle("" "" "" "") label title(Non-Response to Sensitive Question\label{tab:nonresp}) note(Logistic regression with barangay-clustered SE.) replace

*TABLE 2(appendix): Would report anti-government group to the police
xtset psgc
eststo clear
eststo: logit reportNPA selfenum, cl(psgc)
eststo: xtlogit reportNPA selfenum, fe
eststo: xtlogit reportNPA selfenum crowd selfenum_crowd male age education income, fe
*esttab using "nonresp_placebo.tex", se star(* .10 ** .05 *** .01) nodep order() mtitle("" "" "" "" "") label title(Non-Response to Placebo Question\label{tab:nonrespplac}) note(Logistic regression with barangay-clustered SE.) replace

**Falsification**

*FIGURE 3 (main text): Affirmative Answers by Experimental Group
tab claimHS sensitivecat, column
tab reportNPA sensitivecat, column
*To calculate "Forced" column, see Appendix C "Forced Choice Calculations"

*TABLE 3(appendix): Non-Response to Placebo QUestion
xtset psgc
eststo clear
eststo: logit placnr i.sensitivecat, cl(psgc)
eststo: xtlogit placnr i.sensitivecat, fe
eststo: xtlogit placnr i.sensitivecat crowd selfenum_crowd male age education income, fe
*esttab using "selfvdirect_sensitive.tex", se star(* .10 ** .05 *** .01) nodep order(selfenum crowd) mtitle("" "" "" "" "") label title(Would report anti-government group to the police\label{tab:selfvdirect}) note(Logistic regression with barangay-clustered SE.) replace

*TABLE 4(appendix): Did you graduate high school?
xtset psgc
eststo clear
eststo: logit claimHS selfenum, cl(psgc)
eststo: xtlogit claimHS selfenum, fe
eststo: xtlogit claimHS selfenum crowd selfenum_crowd male age income, fe
*esttab using "selfvdirect_plac.tex", se star(* .10 ** .05 *** .01) nodep order(selfenum crowd) mtitle("" "" "" "" "") label title(Did you graduate high school?\label{tab:selfvdirectplac}) note(Logistic regression with barangay-clustered SE.) replace


**Cognitive Load on Enumerators

*Generate indicator variables for each enumerator
tab enumerator, gen(enumid)
foreach enumerator in enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16 {
	label variable `enumerator'
	}

*TABLE 5 (appendix): Survey Method and Enumerator Effects
eststo clear
eststo: logit reportdir crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, cl(psgc)
eststo: logit reportself crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, cl(psgc)
eststo: rrlogit reportrr crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, pyes(0.5) cl(psgc)
eststo: logit hsdir crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, cl(psgc)
eststo: logit hsself crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, cl(psgc)
eststo: rrlogit hsrr crowd enumid2 enumid3 enumid4 enumid5 enumid6 enumid7 enumid8 enumid9 enumid10 enumid11 enumid12 enumid13 enumid14 enumid15 enumid16, pyes(0.5) cl(psgc)
*esttab using "enumfx.tex", se star(* .10 ** .05 *** .01) nodep order() mtitle("Report" "Report" "Report" "HS" "HS" "HS") label title(Survey Method and Enumerator Effects\label{tab:enumfx}) note(Logistic regression with barangay-clustered SE.) replace

**Heterogeneous Effects by Subgroup

*TABLE 6 (appendix): Heterogeneous Effects on Non-Response
xtset psgc
eststo clear
eststo: logit sensitivenr i.sensitivecat##c.age, cl(psgc)
eststo: logit sensitivenr i.sensitivecat##c.education, cl(psgc)
eststo: logit placnr i.sensitivecat##c.age, cl(psgc)
eststo: logit placnr i.sensitivecat##c.education, cl(psgc)
*esttab using "nonresp_het.tex", se star(* .10 ** .05 *** .01) nodep mtitle("Sensitive" "Sensitive" "Placebo" "Placebo") label title(Heterogeneous Effects on Non-Response\label{tab:nonresphet}) note(Logistic regression with barangay-clustered SE.) replace

*TABLE 7 (appendix): Heterogeneous Effects on Willingness to Report
xtset psgc
eststo clear
eststo: logit reportNPA selfenum##c.age, cl(psgc)
eststo: logit reportNPA selfenum##c.education, cl(psgc)
eststo: logit claimHS selfenum##c.age, cl(psgc)
eststo: logit claimHS selfenum##c.education, cl(psgc)
*esttab using "selfvdirect_het.tex", se star(* .10 ** .05 *** .01) nodep mtitle("Sensitive" "Sensitive" "Placebo" "Placebo") label title(Heterogeneous Effects on Willingness to Report\label{tab:selfvdirhet}) note(Logistic regression with barangay-clustered SE.) replace


*FIGURE 1 (appendix): Pilot Survey Summary Statistics
use "NanesandHaim JEPS Pilot Rep.dta", replace

*It is understandable if any of these questions made you feel uncomfortable. Did any of them make you so uncomfortable that you think we should not ask them of people?
tab q32uncomfortable
*Do you believe that any of these questions are dangerous to ask? Remember that responses are completely anonymous and will only be shared with the researchers.
tab q33dangerous
*How did you feel about using the tablet to enter your answers? 
replace q34selfconfused = "" if q34selfconfused == "x"
tab q34selfconfused
*How did you feel about answering the question based on the coin toss?
replace q36rrconfused =  "" if q36rrconfused == "x"
tab q36rrconfused
*How did you feel about using the tablet to enter your answers?
replace q35selfhonest = "" if q35selfhonest == "x"
tab q35selfhonest
*How did you feel about answering the question based on the coin toss?
replace q37rrhonest = "" if q37rrhonest == "x"
tab q37rrhonest
